﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using QBWeb.Models;
using System.Data.Entity;
using QBWeb.Models.CurriculumFolder;
using QBWeb.Models.QuestionFolder;
using QBWeb.Models.TestFolder;

namespace QBWeb.ViewModels
{
    public class QuestionViewModels
    {
        public TestPaperTb TestPaperTb { get; set; }
        public QuestionTb QuestionTb { get; set; }
        public IEnumerable<QuestionTb> QuestionTbs { get; set; }
        public BigKnowModuleTb BigKnowModuleTb { get; set; }
        public SmallKnowModuleTb SmallKnowModuleTb { get; set; }
    }

    public class DetailsViewModels
    {
        public QuestTypeTb QuestTypeTb { get; set; }
        public IEnumerable<SingleChoiceTb> SingleChoiceTb { get; set; }
        public IEnumerable<TrueFalseTb> TrueFalseTb { get; set; }
        public IEnumerable<BlanksTb> BlanksTb { get; set; }

        public DetailsViewModels()
        {
            var db=new QBDbContext();
            this.QuestTypeTb = new QuestTypeTb();
            this.SingleChoiceTb = db.SingleChoiceTbs.Include(m => m.QuestionTb).ToList();
            this.TrueFalseTb = db.TrueFalseTbs.Include(m => m.QuestionTb).ToList();
            this.BlanksTb = db.BlanksTbs.Include(m => m.QuestionTb).ToList();
        }
    }

    public class SaveQuestion
    {
        public int Index { get; set; }
        public int QuestId { get; set; }
        public int Score { get; set; }
    }
}